# from django.apps import AppConfig


# class BooksConfig(AppConfig):
#     default_auto_field = 'django.db.models.BigAutoField'
#     name = 'books'




from django.apps import AppConfig

class BooksConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'books'
    
    def ready(self):
        # 导入信号处理器
        if not hasattr(self, 'signals_loaded'):
            from . import signals  # noqa
            self.signals_loaded = True
        
        # 自定义管理命令
        from django.core.management.commands import loaddata
        loaddata.Command.loading_model = True